tool = Instance.new("Tool",owner.Backpack) script.Parent = tool tool.Name = "bomb" tool.CanBeDropped = true tool.RequiresHandle = true handle = Instance.new("Part",tool) handle.Name = "Handle" handle.Size = Vector3.new(0.5, 1, 0.5) hmesh = Instance.new("SpecialMesh",handle) hmesh.MeshId = "http://www.roblox.com/asset/?id=88742707" hmesh.TextureId = "http://www.roblox.com/asset/?id=88742969" hmesh.Scale = Vector3.new(0.792, 0.792, 0.792) hmesh.Offset = Vector3.new(0, 0.5, 0) tool.GripUp = Vector3.new(0, 1, 0) tool.GripRight = Vector3.new(-0.997, 0, 0.081) tool.GripPos = Vector3.new(0, -0.667, 0) tool.GripForward = Vector3.new(0.081, 0, 0.997) event = Instance.new("RemoteEvent",tool) event.Name = "Fire" NLS([[ local mouse = game.Players.LocalPlayer:GetMouse() tool = script.Parent tool.Activated:Connect(function() local MousePos = mouse.Hit.p script.Parent.Fire:FireServer(MousePos) end) ]],tool) --[[Bezier]]-- local function lerp(p0,p1,t) return p0*(1-t) + p1*t end local function quad(p0,p1,p2,t) local l1 = lerp(p0,p1,t) local l2 = lerp(p0,p2,t) local quad = lerp(l1,l2,t) return quad end junk = game:GetService("Debris") script.Parent.Fire.OnServerEvent:Connect(function(player,MousePos) local warhead = Instance.new("Part") warhead.Size = Vector3.new(1.5,1.5,6) warhead.CFrame = CFrame.Angles(math.rad(-90),0,0) warhead.Position = MousePos + Vector3.new(0,1000,0) warhead.Parent = game.Workspace warhead.Anchored = true local density = 10 local friction = 10 local elasticity = 0 local frictionWeight = 10 local elasticityWeight = 0 local physProperties = PhysicalProperties.new(density, friction, elasticity, frictionWeight, elasticityWeight) warhead.CustomPhysicalProperties = physProperties local marker = Instance.new("Part") marker.Name = "Marker" marker.Size = Vector3.new(10,10,10) marker.Shape = "Ball" marker.Material = "Neon" marker.BrickColor = BrickColor.new("New Yeller") marker.Transparency = 1 marker.CanCollide = false marker.TopSurface = "Smooth" marker.BottomSurface = "Smooth" marker.Position = MousePos + Vector3.new(0,-2.5,0) marker.Anchored = true marker.Parent = game.Workspace local tp = Instance.new("Part") tp.Transparency = .5 tp.Name = "Effect" tp.Anchored = true tp.CanCollide = false tp.Size = Vector3.new(0,0,0) tp.BrickColor = BrickColor.new("Lime green") tp.Position = MousePos tp.Parent = game.Workspace tp.Orientation = Vector3.new(-90, 180, 180) local me=Instance.new("SpecialMesh") me.MeshId="http://www.roblox.com/asset/?id=3270017" me.Scale=Vector3.new(40,40,1) me.Parent=tp local mesh = Instance.new("SpecialMesh") mesh.MeshId = "http://www.roblox.com/asset/?id=88782666" mesh.TextureId = "http://www.roblox.com/asset/?id=88782631" mesh.Scale = Vector3.new(4.5, 4.5, 3) mesh.Parent = warhead local sound = Instance.new("Sound") sound.SoundId = "rbxasset://sounds\\Rocket shot.wav" sound.Volume = 3 sound.PlaybackSpeed = 1 sound.Parent = warhead local start = MousePos + Vector3.new(0,1000,0) local finish = MousePos local middle = (finish - start) + Vector3.new(MousePos.X,0,MousePos.Z) local max = 50 for i = 1,max do local t = i/max local update = quad(start,middle,finish,t) warhead.Position = update task.wait() end for _,v in pairs(warhead:GetChildren()) do if v:IsA("Attachment") then v:Destroy() end end local e = Instance.new("Explosion") e.BlastPressure = 600000 e.BlastRadius = 15 e.DestroyJointRadiusPercent = 15 -- yes joint breakers e.Position = warhead.Position e.Parent = warhead tp:Destroy() e.Hit:Connect(function(hit) if hit.Anchored == true then hit.Anchored = false end hit:BreakJoints() --[[ if not part.Anchored then part.Velocity = (part.CFrame.p-e.Position).unit*(e.BlastPressure/100) end ]]-- for _,joints in pairs(hit:GetJoints()) do joints:Destroy() end warhead.Sound:Play() warhead.Transparency = 1 warhead.CanCollide = false junk:AddItem(marker,1) junk:AddItem(warhead,3) junk:AddItem(e,5) --con:Disconnect() end) --[[touched function]]-- --[[ con = warhead.Touched:Connect(function(part) if con ~= marker then for _,v in pairs(warhead:GetChildren()) do if v:IsA("Attachment") then v:Destroy() end end local e = Instance.new("Explosion") e.BlastPressure = 60000 e.BlastRadius = 40 e.DestroyJointRadiusPercent = 40 -- yes joint breakers e.Position = warhead.Position e.Parent = warhead e.Hit:Connect(function(hit) if part.Name ~= "Base" and part.Name ~= "Marker" then part.Anchored = false end if hit.Name ~= "Base" and hit.Name ~= "Marker" then hit.Anchored = false end local Humanoid = hit.Parent:FindFirstChildOfClass("Humanoid") if Humanoid then Humanoid.Parent:BreakJoints() end if not part.Anchored then part.Velocity = (part.CFrame.p-e.Position).unit*(e.BlastPressure/100) end for _,joints in pairs(hit:GetJoints()) do joints:Destroy() end warhead.Sound:Play() warhead.Transparency = 1 warhead.CanCollide = false junk:AddItem(marker,1) junk:AddItem(warhead,3) junk:AddItem(e,5) --con:Disconnect() end) end end) ]]-- end)